Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: #18 RaygunErrorBoundary tests #53

Merged
merged 16 commits into from
Oct 9, 2024
Merged

Conversation

miquelbeltran
Copy link
Contributor

@miquelbeltran miquelbeltran commented Oct 4, 2024

test: #18 RaygunErrorBoundary tests

Description 📝

Type of change

  • Tests

Updates

  • Created Raygun.Tests.Blazor.Server.
  • Removed Raygun.Tests.Blazor.WebAssembly (project was empty, could be added again if necessary)
  • Created a test component TestComponent that throws an exception when a button is clicked. This component is wrapped by the RaygunErrorBoundary.
  • The tests tap on the button in the TestComponent, which throws an exception and gets captured, the tests verify that the http mock client has captured the exception. Testing the solution end-to-end.

Test plan 🧪

  • Newly created unit test should pass.

Author to check 👓

  • Project and all contained modules builds successfully
  • Self-/dev-tested
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

Reviewer to check ✔️

  • Project and all contained modules builds successfully
  • Change has been dev-/reviewer-tested, where possible
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

@@ -10,7 +10,7 @@ namespace Raygun.Blazor.Models
/// This exists because we need to parse some stuff from the browser to construct a proper <see cref="EnvironmentDetails" />
/// instance. Also the <see cref="EnvironmentDetails" /> is a hot mess of JavaScript serialization inconsistency.
/// </remarks>
internal record BrowserSpecs
public record BrowserSpecs
Copy link
Contributor Author

@miquelbeltran miquelbeltran Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made public so it is accessible from the Raygun.Tests.Blazor.Server project

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the need to do that, but it kind of breaks encapsulation a bit for the same of the code being ore testable. I think that's a choice that can be made consciously, but are there other ways to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, see 45d0423 (#53)

Base automatically changed from fix-ci to main October 5, 2024 06:56
@miquelbeltran miquelbeltran requested review from a team, nikz, TheRealAgentK, PanosNB and sumitramanga and removed request for a team October 7, 2024 08:00
Copy link
Contributor

@TheRealAgentK TheRealAgentK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@miquelbeltran miquelbeltran merged commit f4ea4fb into main Oct 9, 2024
3 checks passed
@miquelbeltran miquelbeltran deleted the error-boundary-tests branch October 9, 2024 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raygun.Tests.Blazor.* : RaygunErrorBoundary tests
2 participants